package com.dbh.innerclass;

import com.dbh.Person;

import java.util.function.Consumer;

/**
 *  Consumer
 *
 *  Consumer代表了在一个输入参数上需要进行的操作。
 *
 * @author dongbanghui
 * @date 2018/08/15
 */
public class ConsumersDemo {

    public static void main(String[] args) {
        Consumer<Person> greeter = (p) -> System.out.println("Hello, " + p.firstName);
        greeter.accept(new Person("Luke", "Skywalker"));
    }
}
